﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Template.aspx.cs" Inherits="PPAP.Web.Master.Template" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head >
    <title></title>
   <script language="javascript">
       function edit(id) {
           url = "TemplateEdit.aspx?DID=" + id;
           PopUpWindow(url, 230, 160, 730, 420);
       }
       function del(id) {
           if (confirm('Please confirm to delete the file.')) {
               url = "Template.aspx?deid=" + id;
               window.location.href = url;
           }
       }
		</script>
</head>
<body  style="font-family: Arial, Helvetica, sans-serif;" >
    <form id="form1" runat="server">
    <div>
    
<asp:GridView ID="GridView1" runat="server" CellPadding="4" Width="100%" ForeColor="#333333" 
            GridLines="None" AutoGenerateColumns="False">
    <AlternatingRowStyle BackColor="White" />
    <Columns>
        <asp:TemplateField HeaderText="No." ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label1" runat="server" Text='<%# Eval("rownum") %>'></asp:Label>
            </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
       
        <asp:TemplateField HeaderText="Template Type" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label2" runat="server" Text='<%# Eval("attachmenttype") %>'></asp:Label>
            </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="BDNT Template Available" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label3" runat="server" Text='<%# Eval("BDNTTEMPLATEAVAILABLE").ToString()=="1"?"Y":"N" %>'></asp:Label>
            </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Suppliers' Template Accepted" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label4" runat="server" Text='<%# Eval("SUPPLIERSTEMPLATEACCEPTED").ToString()=="1"?"Y":"N" %>'></asp:Label>
            </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Remark" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label5" runat="server" Text='<%# Eval("REMARK") %>'></asp:Label>
            </ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>

         <asp:TemplateField HeaderText="Level1" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label6" runat="server" Text='<%# Eval("ISLEVEL1").ToString()=="1"?"Y":"N" %>'></asp:Label>
            </ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>

         <asp:TemplateField HeaderText="Level2" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label7" runat="server" Text='<%# Eval("ISLEVEL2").ToString()=="1"?"Y":"N" %>'></asp:Label>
            </ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>

         <asp:TemplateField HeaderText="Level3" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label8" runat="server" Text='<%# Eval("ISLEVEL3").ToString()=="1"?"Y":"N" %>'></asp:Label>
            </ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>

         <asp:TemplateField HeaderText="Uploaded by" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label9" runat="server" Text='<%# Eval("UPLOADEDBY") %>'></asp:Label>
            </ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>

         <asp:TemplateField HeaderText="Last modified Date" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Label ID="Label10" runat="server" Text='<%#Eval("LASTMODIFIEDDATE").ToString()==""?"":DateTime.Parse(Eval("LASTMODIFIEDDATE").ToString()).ToString("yyyy-MM-dd")  %>'></asp:Label>
            </ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>


        <asp:HyperLinkField DataNavigateUrlFields="ID"  Visible="false" HeaderText="Edit" ItemStyle-HorizontalAlign="Center"
            DataNavigateUrlFormatString="javascript:edit('{0}');" Text="Edit" >
<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:HyperLinkField>
         <asp:TemplateField HeaderText="Edit"  ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:LinkButton ID="LinkButton2" Visible="false" PostBackUrl=<%#"javascript:edit("+Eval("ID")+");" %> runat="server">Edit</asp:LinkButton>
                <img src="../Images/newimg/write.png" title="Edit" onclick="<%#"javascript:edit("+Eval("ID")+");" %>" />
            </ItemTemplate>
        </asp:TemplateField>
            <asp:TemplateField HeaderText="Delete" Visible="false" ItemStyle-HorizontalAlign="Center">
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton1" Visible="false"  runat="server" onclientclick="return confirm('Please confirm to delete the file.')" 
                        PostBackUrl=<%# "Template.aspx?deid="+Eval("ID") %>
                        >Delete</asp:LinkButton>
                        <img src="../Images/newimg/delete.png" title="Delete" onclick="<%#"javascript:del("+Eval("ID")+");" %>" />
                </ItemTemplate>

<ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
       
    </Columns>
     <EditRowStyle BackColor="#2E8AC5" />
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#E7E8E8" Font-Bold="True" ForeColor="#000000" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    </div>
    
    
    </form>
</body>
</html>
